<?php
class MY_Config extends CI_Config {

/**
 * Extended Config Library - This class extends the config to a database or XML
 *
 * @version		  0.2
 * @last_update September 10, 2007  
 * @package		  CodeIgniter
 * @subpackage	Extended Config Library
 * @category    Extended Core
 * @author		  Tim Wood [codearachnid]
 * @link		    http://code.codearachnid.com
 * 
 * you must have the following structure setup in order to use this class
 * 
	CREATE TABLE IF NOT EXISTS `site_config` (
	  `config_id` int(11) NOT NULL auto_increment,
	  `last_updated` timestamp NOT NULL default '0000-00-00 00:00:00' on update CURRENT_TIMESTAMP,
	  `config_key` varchar(60) NOT NULL,
	  `config_value` longtext NOT NULL,
	  PRIMARY KEY  (`config_id`)
	) ENGINE=MyISAM;
 * 
 * 
 */

  var $CI;

  function MY_Config()
  {
    parent::CI_Config();
    $this->CI =& get_instance();
  }
  
  function config_fetch()
  {
  	
  	$query = $this->CI->db->get($this->item('dbt_site_config'));
  	
		foreach ($query->result_array() as $row)
		{
			$this->config[$row['config_key']] = $row['config_value'];
		}
	
  }
    
}
?>
